package com.smiletrain.view;

import android.widget.ImageView;

public class RadioBoton { 
	
	public RadioBoton(int id, ImageView view, boolean selected, int select, int unselect) {
		this.id = id;
		this.view = view;
		this.selected = selected;
		this.select = select;
		this.unselect = unselect;
		select(selected);
	}
	
	public void select(boolean s){
		selected = s;
		if(selected){
			view.setImageResource(select);
		} else {
			view.setImageResource(unselect);
		}
	}
	
	public void select(){
		select(!selected);
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public ImageView getView() {
		return view;
	}

	public void setView(ImageView view) {
		this.view = view;
	}

	public boolean isSelected() {
		return selected;
	}

	public void setSelected(boolean selected) {
		this.selected = selected;
		if(selected){
			view.setImageResource(select);
		} else {
			view.setImageResource(unselect);
		}
	}

	private int id;
	private ImageView view; 
	private boolean selected;
	private int select;
	private int unselect;
	
}
